﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        int a = 1;
        public Form1()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Form Form2 = new Form2();
            Form2.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            
            
            this.Icon = Properties.Resources.Icon1;
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Icon = default(Icon);
           
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (a == 1)
            {
                ChangeLanguage("nl-NL");
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
                a = 9;
            }
            else {

                ChangeLanguage("en");
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); 
                a = 1;
            }
            
            
        }
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {

        }

    }
}
